import Action from './action'
import Plugin from './plugin'
import EN 	  from './event-name'
import CN 	  from './class-name'
import Icon   from './icon' 
let {paint,plugin,action} = EN
export const NavType = {paint,plugin,action}

let navs = {
	logo:`<label id="${CN.avatar}" class="${[CN.avatar,CN.iconfont,Icon.avatar].join(' ')}"></label>`,
	tpl:`<button id="{id}" title="{text}" data-action="{action}" class="${[CN.btn,CN.iconfont].join(' ')} {children?'geo-p-menu':''} {cla} {icon}"><label>{text}</label></button>`,
	items:[
		{text:"关闭",		action:Action.powerOff, 	type:NavType.action,fixed:true,	cla:CN.powerOff,},
		{text:"回撤",		action:Action.undo,			type:NavType.action,fixed:true},
		
		{text:"版本管理",		action:Action.Version, 		type:NavType.paint,fixed:true},
		{text:"函数绘制",		action:Action.FunctionTool, type:NavType.paint,fixed:true},

		{text:"路径移除",		action:Action.PathRemove, 	type:NavType.paint,	fixed:true},
		{text:"路径选择",		action:Action.PathFocus,	type:NavType.paint,	fixed:true},
		{text:"路径旋转",		action:Action.PathRotate,	type:NavType.paint, fixed:true},
		{text:"绘点",		action:Action.Point, 		type:NavType.paint },
		{text:"绘线",		icon:Icon.lines ,
			children:[
				{text:"直线",	action:Action.Line,		type:NavType.paint,	plugins:[Plugin.line]},
				{text:"射线",	action:Action.Ray,		type:NavType.paint,	plugins:[Plugin.line]},
				{text:"线段",	action:Action.Linend,	type:NavType.paint,	plugins:[Plugin.line],active:true},
				{text:"折线",	action:Action.Foldline,	type:NavType.paint,	plugins:[Plugin.line]},
				{text:"圆外切线",	action:Action.CutLine, 	type:NavType.paint, plugins:[Plugin.line]},
				{text:"圆上切线",	action:Action.CircleCut,		type:NavType.paint,	plugins:[Plugin.line]},
				{text:"垂线",	action:Action.VerticalLine,		type:NavType.paint,	plugins:[Plugin.line]},
				{text:"平行线",	action:Action.ParaLine,			type:NavType.paint,	plugins:[Plugin.line]},
				{text:"角平分线",	action:Action.HalfAngleLine,	type:NavType.paint,	plugins:[Plugin.line]},
				{text:"中线",	action:Action.CentralLine,		type:NavType.paint,	plugins:[Plugin.line]}
			]
		},
		
		{text:"矩形",		action:Action.Rect,			type:NavType.paint,	plugins:[Plugin.line]},
		{text:"绘圆",		icon:Icon.circles,
			children:[
			{text:"圆形",		action:Action.Circle,	type:NavType.paint,	plugins:[Plugin.line]},
			{text:"外切圆",		action:Action.CircleOuter, 	type:NavType.paint, plugins:[Plugin.line]},
			{text:"三点圆",		action:Action.Circle3p, type:NavType.paint, plugins:[Plugin.line]},
			{text:"椭圆",		action:Action.Ellipse,	type:NavType.paint,	plugins:[Plugin.line] }]
		},
		{text:"角度",		action:Action.Angle,		type:NavType.paint,		plugins:[Plugin.line]},
		{text:"正多边形",		action:Action.Polygon,		type:NavType.paint ,	plugins:[Plugin.line]},
		{text:"交汇点",		action:Action.CrossPoint,	type:NavType.paint },
		{text:"中点",		action:Action.CentralPoint, type:NavType.paint },
		{text:"对称",		icon:Icon.mirror,
			children:[
				{text:"对称点",		action:Action.MirrorPoint, 	type:NavType.paint },
				{text:"对称线",		action:Action.MirrorLine, 	type:NavType.paint },
				{text:"对称路径",		action:Action.MirrorPath, 	type:NavType.paint }
			]
		},
		{text:"画笔",		action:Action.Pen,	type:NavType.paint,		plugins:[Plugin.line]},
		{text:"文字标注",		action:Action.Text,	type:NavType.paint},
		{text:"颜色选择器",	action:Plugin.color,type:NavType.action },
		{text:"图片选择器",	action:Action.Image,type:NavType.paint, 	plugins:[Plugin.image]},
		{text:"尺子",		action:Action.Ruler, 		type:NavType.paint}
	]
}
navs.items.forEach(item=>{
	if(item.children){
		item.children.forEach(i=>i.icon=Icon[i.action])
	}else
	item.icon = Icon[item.action]
})
export const Nav = navs